import { Injectable } from '@nestjs/common';
import { UsersRepository } from './users.repository';
import { User } from './entities/user.entity';
import { CreateUserDto } from './dto/create-user.dto';
import { GetUserFilterDto } from './dto/getUserFilterDto';
import { updateUser, UserAllDto } from './dto/userAll.dto';
import { IPaginationOptions, Pagination } from '../utils/paginate';
import { UpdatePasswordDto } from './dto/updatePassword.dto';

@Injectable()
export class UserService extends UsersRepository {
  async deleteUsers(id: string): Promise<void> {
    return super.deleteUser(id);
  }
  async getUserByIds(id: string): Promise<User> {
    return super.getUserById(id);
  }
  async getUserInfos(user: User): Promise<User> {
    return super.getUserInfo(user);
  }
  async updateUsers(userAllDto: UserAllDto, user: User): Promise<User> {
    return super.updateUser(userAllDto, user);
  }
  async updateUserByIds(userAllDto: updateUser, user: User): Promise<User> {
    return super.updateUserById(userAllDto, user);
  }
  async updatePassword(updatePassword: UpdatePasswordDto, user: User) {
    return super.updateUserPassword(updatePassword, user);
  }
  async getUserLists(
    getUserFilterDto: GetUserFilterDto,
    options: IPaginationOptions,
  ): Promise<Pagination<User>> {
    return super.getUserList(getUserFilterDto, options);
  }
}
